<?php
namespace app\common\validate;
use think\Validate;

class Menu extends Validate
{
    protected $rule = [
        ['id','require','id不许为空'],
        ['fid','require|number','父类id不能为空|id必须是数值型'],
        ['name','require','权限名称不能为空'],
        ['sort','number|between:0,99','排序序号必须是数值|排序序号在0到99之间'],
        ['module','require','类名称不能为空'],
        ['action','require','方法名称不能为空'],
        ['show','number','必须是数值']
    ];
    protected $scene = [
        'topadd'=> [
            'fid','name','sort'
        ],
        'add' => [
            'fid','name','sort','module','action'
        ],
        'edit_sort' => [
            'id','sort'
        ],
        'edit_show' => [
            'id','show'
        ]
    ];
}